package com.atguigu.jxc.controller;

import com.atguigu.jxc.domain.ServiceVO;
import com.atguigu.jxc.domain.SuccessCode;
import com.atguigu.jxc.entity.OverflowList;
import com.atguigu.jxc.service.OverflowListGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @ClassName OverflowListGoodsControllerr
 * @Author 波
 * @Date 2024/9/25 10:04
 */
@RestController
@RequestMapping("/overflowListGoods")
public class OverflowListGoodsController {
    @Autowired
    private OverflowListGoodsService overflowListGoodsService;

    @PostMapping("/save")
    public ServiceVO save(OverflowList overflowList, @RequestParam("overflowListGoodsStr") String overflowListGoodsStr) {
        overflowListGoodsService.save(overflowList, overflowListGoodsStr);
        return new ServiceVO(SuccessCode.SUCCESS_CODE, SuccessCode.SUCCESS_MESS);

    }
    @PostMapping("/list")
    public Map<String, Object> list(String sTime, String eTime) {
        return overflowListGoodsService.list(sTime, eTime);
    }

    @PostMapping("/goodsList")
    public Map<String, Object> goodsList(Integer overflowListId) {
        return overflowListGoodsService.getGoodsList(overflowListId);
    }
}
